
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { TableWidthConfig } from 'ng-devui';
import { StorehouseService } from 'src/app/@core/services/storehouse/storehouse.service';

@Component({
  selector: 'app-scfld-details',
  templateUrl: './scfld-details.component.html',
  styleUrls: ['./scfld-details.component.scss']
})
export class ScfldDetailsComponent {
  id:any=null
  detail:any ={}
  tableData:any=[]
  dataTableOptions={
    columns:[
      {
          field: 'name',
          header: '工单号',
          fieldType: 'text',
      },
      {
        field: 'name',
        header: '工序名称',
        fieldType: 'text',
      },
      {
        field: 'name',
        header: '物料名称',
        fieldType: 'text',
      },
      {
        field: 'name',
        header: '规格',
        fieldType: 'text',
      },
      {
        field: 'name',
        header: '单位',
        fieldType: 'text',
      },
      {
        field: 'name',
        header: '需求数量',
        fieldType: 'text',
      },
      {
        field: 'name',
        header: '发料数量',
        fieldType: 'text',
      },
      {
        field: 'name',
        header: '仓库',
        fieldType: 'text',
      },
      {
        field: 'name',
        header: '仓位',
        fieldType: 'text',
      }


    ]
  }
  tableWidthConfig: TableWidthConfig[] = [
    {
      field:'工单号',
      width:'150px'
    },
    {
      field:'销售订单号',
      width:'100px'
    },
    {
      field:'销售订单号',
      width:'100px'
    },
    {
      field:'产品编码',
      width:'100px'
    },
    {
      field:'产品编码',
      width:'100px'
    },

    {
      field:'产品编码',
      width:'100px'
    },
    {
      field:'规格',
      width:'150px'
    },
    {
      field:'单位',
      width:'150px'
    },
    {
      field:'计划数量',
      width:'150px'
    },




  ];
  constructor(private route: ActivatedRoute,private StorehouseService:StorehouseService,private router:Router) {
    this.route.params.subscribe(params => {
      this.id = params['id'];
    });
  }
  ngOnInit(): void {
    this.StorehouseService.GetJobOrderIssueById(this.id).subscribe((res:any)=>{
      this.detail = res
      this.tableData = res.jobOrderIssueDetails
    })
  }
  cancle(){
    this.router.navigate(['/pages/product/product-job-pink'])
  }
}
